﻿CREATE PROCEDURE [dbo].[kp_GetCtNganhKdByHoSo]
	@HoSo_Rec nvarchar(10)
AS
	Select cast(len(IsNull(CT.Stt_Rec,'')) as bit) Choice, ISNULL(CT.Stt_Rec,@HoSo_Rec) Stt_Rec,DM.Ma_Nganh,DM.Ten_Nganh FROM
	(Select Stt_Rec,Ma_Nganh From tblCtNganhKd where Stt_Rec= @HoSo_Rec ) CT
		 right join tblDmNganh DM
			ON DM.Ma_Nganh=CT.Ma_Nganh
RETURN 0;